#pragma once
#include "DXUT.h"
#include "DXUTmisc.h"
#include "DXUTgui.h"
#include "SDKmisc.h"
#include "SDKmesh.h"
#include "d3dx11effect.h"

#define DEG2RAD( a ) ( a * D3DX_PI / 180.f )

class Camera
{
public:
	Camera(void);
	Camera(const D3DXVECTOR3&, const D3DXVECTOR3&, const D3DXVECTOR3&, const float, const float);
	~Camera(void);

	void Initialize(const D3DXVECTOR3&, const D3DXVECTOR3&, const D3DXVECTOR3&, const LONG, const LONG);
	void GoLeft(float);
	void GoRight(float);
	void GoForward(float);
	void GoBackward(float);
	void GoUp(float);
	void GoDown(float);
	void LookAt(float, float);

	void SetReflectionViewMatrix();

	D3DXVECTOR3 GetPosition() const;
	D3DXVECTOR3 GetRotation() const;

	void SetPosition(D3DXVECTOR3&);
	void SetRotation(D3DXVECTOR3&);

	void CreateViewMatrix();
	void CreateReflectionMatrix(float);

	D3DXMATRIX GetViewMatrix() const;
	D3DXMATRIX GetReflectionMatrix() const;
	D3DXMATRIX GetProjectionMatrix() const;

private:
	static const float CAMERA_SPEED;
	D3DXVECTOR3 m_Rotation;
	D3DXVECTOR3 m_Position;
	D3DXVECTOR3 m_RightVector;
	D3DXVECTOR3 m_UpVector;
	D3DXVECTOR3 m_AtVector;

	D3DXMATRIX m_View;
	D3DXMATRIX m_Reflection;
	D3DXMATRIX m_Projection;
};

